package com.rw.test;

import com.rw.tool.util.random.RandomUtil;

public class ZhenJi extends Hero {
    //姓名
    String name = "虞姬";

    //势力
    Force force = Force.wei;

    //效果说明
    String effectDescription = "洛神：每颗骰子有50%概率额外重掷一次";

    //是否限定技
    boolean isLimitedSkills = false;

    //是否已经使用
    boolean isUsed = false;

    //是否可以在商店阶段使用
    boolean shopping = false;

    //是否可以在投掷阶段使用
    boolean throwingPhase = false;

    //是否可以在伤害修正阶段使用
    boolean damageSettlementPhase = false;

    //是否可以在死亡阶段使用
    boolean deathPhase = false;

    @Override
    public void effect(Player player) {
        int R0 = 0;//杀的数量
        int R1 = 0;//闪的数量
        int R2 = 0;//桃的数量
        int R3 = 0;//酒的数量
        int diceReRoll = player.dice;
        while (diceReRoll != 0) {
            int isReRoll = RandomUtil.nextInt(1);
            if (isReRoll == 1) {
                int num = RandomUtil.nextInt(3);
                switch (num) {
                    case 0:
                        R0 += R0;
                    case 1:
                        R1 += R1;
                    case 2:
                        R2 += R2;
                    case 3:
                        R3 += R3;
                }
                player.dice_killAfter += R0;
                player.dice_dodgeAfter += R1;
                player.dice_peachAfter += R2;
                player.dice_liquorAfter += R3;
            } else {
                diceReRoll--;
            }
        }
        System.out.println("洛神结束。共获得了" + R0 + "个杀；" + R1 + "个闪；" + R2 + "个桃；" + R3 + "个酒。");

    }
}
